/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package SourceCode;

import java.util.ArrayList;

/**
 *
 * @author ssaad
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

       // SerializationGenerator.Generate();
        
        LoadAndShow();


    }
    public static void LoadAndShow()
    {

        //SerializationGenerator.getSerialization();
        //load whole data
        LibraryGeneral.LoadAllInitialData();
        //test data
       for(Member m : LibraryGeneral.S_Members)
       {

        System.out.println("Member:  "+ m.tostring());
        for(Loan lone : m.loans)
        {
            System.out.println("Loans  " + lone.getCopy().tostring());
        }

        for(Reservation r : m.reservations)
        {
            System.out.println("Reservation  " + r.getItem().tostring());
        }

       }
        System.out.println("************Item Details ***************: ");
       //show list of all copies of all items and number of available copies
       for(Item item : LibraryGeneral.S_Books)
       {
           System.out.println("Item: " + item.tostring());
           System.out.println("Total Item Copies: " + item.Copies.size());
           System.out.println("Available Item Copies: " + item.AvailabeCopy());
           System.out.println("Copy Details: " + item.AvailabeCopy());
           for(Copy copy : item.Copies)
           {
               System.out.println("Copy: " + copy.tostring());
           }

       }
       //list of all copies of magazine
       for(Item item : LibraryGeneral.S_Magazines)
       {
           System.out.println("Item: " + item.tostring());
           System.out.println("Total Item Copies: " + item.Copies.size());
           System.out.println("Available Item Copies: " + item.AvailabeCopy());
           System.out.println("Copy Details: " + item.AvailabeCopy());
           for(Copy copy : item.Copies)
           {
               System.out.println("Copy: " + copy.tostring());
           }

       }
    }

}
